/*
package com.wz.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Address;
import org.web3j.abi.datatypes.BytesType;
import org.web3j.abi.datatypes.Function;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.generated.Uint256;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.RemoteCall;
import org.web3j.protocol.http.HttpService;
import org.web3j.tx.Contract;
import org.web3j.tx.TransactionManager;

import java.math.BigInteger;
import java.util.Arrays;

*/
/**
 * @program: demo
 * @description: 合约构造
 * @author: Wangzheng
 * @create: 2020-12-23 15:55
 **//*

@Configuration
public class ContractConfig extends Contract {
	Web3j web3j = Web3j.build(new HttpService(Normal.SERVER));

	protected ContractConfig(String contractBinary, String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
		super(contractBinary, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
	}
	
	@Bean
	public RemoteCall<BigInteger> balanceOf(String owner) {
		final Function function = new Function("balanceOf",
				Arrays.<Type>asList(new Address(owner)),
				Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
		return executeRemoteCallSingleValueReturn(function, BigInteger.class);
	}


	@Bean
	public RemoteCall<String> owner() {
		final Function function = new Function("owner",
				Arrays.<Type>asList(),
				Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
		return executeRemoteCallSingleValueReturn(function, String.class);
	}
}*/
